package com.example.datasync.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.datasync.service.OrgService;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ZhangRui
 * @date 2022/11/25 15:47
 **/
@Service
public class OrgServiceImpl implements OrgService {

    private final JdbcTemplate jdbcTemplate;

    public OrgServiceImpl(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    @DS("slave_1")
    public List selectOrg() {
        return jdbcTemplate.queryForList("select * from `uc_org` where `name` = '个人版' and del_flag = 0 order by create_time");
    }
}
